﻿using System;
using UtfprLibrary.Exceptions;

namespace UtfprLibrary.Configurations.DesignTime {
    /// <summary>
    /// TODO
    /// </summary>
    public static class UtfprSettings {
        /// <summary>
        /// TODO
        /// </summary>
        /// <exception cref="UtfprLibrary.Exceptions.UtfprConfigurationsException">Thrown when an exception occurs.</exception>
        public static UtfprSection Settings =
            ConfigurationManager.GetSection(Properties.Resources.Configurations_Const_Section) as UtfprSection;

        /// <summary>
        /// TODO
        /// </summary>
        /// <exception cref="UtfprLibrary.Exceptions.UtfprConfigurationsException">Thrown when an exception occurs.</exception>
        static UtfprSettings() {
            if (Settings == null) {
                throw new UtfprConfigurationsException("Section '" + Properties.Resources.Configurations_Const_Section + "' not found.");
            }
        }
    }
}
